#include "fTaskImpl.h"

fTaskImpl::fTaskImpl(FTaskMode mode, QWidget *parent)
	: QWidget(parent), m_mode(mode)
{
	m_fTask = new fTask;
	m_fTask->setupUi(this);
	
	m_fTask->cbProviders->addItems(CTaskProviders::instance()->availableTaskProvider());
}

void fTaskImpl::setTask(STask *task)
{
	m_task = task;
	if(m_task != 0)
	{
		m_fTask->eName->setText(m_task->name);
		m_fTask->eDesc->setText(m_task->description);
		m_fTask->dtDueDate->setDate(m_task->dueDate.date());
		m_fTask->dtAddDate->setDate(m_task->addDate.date());
	}
}

STask* fTaskImpl::task()
{
	return m_task;
}
